package com.atguigu.springcloud.controller;


import com.atguigu.springcloud.entity.CommonResult;
import com.atguigu.springcloud.entity.Payment;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaoge
 * @since 2021-11-29
 */
@RestController
@RequestMapping("/payment")
public class PaymentController {

    @Value("${server.port}")
    private String serverPort;

    @PostMapping("/lb")
    public CommonResult<Payment> create(Payment payment){
        CommonResult<Payment>  result= new CommonResult<>();
        result.setCode(200);
        result.setMessage("lb成功"+"端口号: "+serverPort);
        return result;
    }

    @GetMapping("/get")
    public CommonResult<Payment> create(){
        CommonResult<Payment>  result= new CommonResult<>();
        result.setCode(200);
        result.setMessage("get成功"+"端口号: "+serverPort);
        return result;
    }

}

